<?php
require dirname(__FILE__).'/include/common.inc.php';
require_once 'admin/content.class.php';

if($contentid)
{
    $c = new content();
    $r = $c->get_count($contentid);
    if(!$r) exit;
    if ($PHPCMS['category_count'])
    {
        require_once 'count.class.php';
        $count = new count();
        $count->add($contentid);
    }
    extract($r);
    if($model != 'down')
    {
        $c->hits($contentid);
    }
    else
    {
        echo "\$('#todaydowns').html('$hits_day');";
        echo "\$('#weekdowns').html('$hits_week');";
        echo "\$('#monthdowns').html('$hits_month');";
    }
	
	
	//记录关键词浏览信息并统计start
	require_once 'lvmao_keyword.php';
	
	global $db;
	global $_userid;
	
	$sql="select keywords from ".DB_PRE."content where contentid=".$contentid;
	$re=$db->query($sql);
	$re=$db->fetch_array($re);
	
	$keywords=$re[keywords];
//	echo $keywords;
//	//echo "<!--";
//	echo $_userid."-".$keywords;
	if($_userid)
	{
		if($keywords!="")
		{
			$uid=GetId();
			
			//调用自定义函数记录用户关键词浏览信息
			AddUserTag($uid,$keywords);
			
			
		}
	}
	//echo "-->";
	//记录关键词浏览信息并统计end
	
	
}
elseif($specialid)
{
    require_once 'comment/api/comment_api.class.php';
    $count = new comment_api();
    $comments = $count->get_count($specialid);
    $hits = 0;
}
?>
$('#hits').html('<?=$hits?>');
$('#comments').html('<?=$comments?>');
$('#comments_top').html('<?=$comments?>');